A = readmatrix('switchtest.txt')
A1 = readmatrix('switch_photocurrent_1.txt')
A2 = readmatrix('switch_photocurrent_2.txt')
A3 = readmatrix('switch_photocurrent_3.txt')
A4 = readmatrix('switch_photocurrent_4.txt')
A5 = readmatrix('switch_photocurrent_5.txt')
A6 = readmatrix('switch_photocurrent_6.txt')
A7 = readmatrix('switch_photocurrent_7.txt')
A8 = readmatrix('switch_photocurrent_8.txt')
A9 = readmatrix('switch_photocurrent_9.txt')
A10 = readmatrix('switch_photocurrent_10.txt')

x = A(:,1)
y1 = A(:,2)
y2 = A(:,3)
y3 = A(:,4)

x1 = A1(:,1)
z1 = A1(:,2)

x2 = A2(:,1)
z2 = A2(:,2)

x3 = A3(:,1)
z3 = A3(:,2)

x4 = A4(:,1)
z4 = A4(:,2)

x5 = A5(:,1)
z5 = A5(:,2)

x6 = A6(:,1)
z6 = A6(:,2)

x7 = A7(:,1)
z7 = A7(:,2)

x8 = A8(:,1)
z8 = A8(:,2)

x9 = A9(:,1)
z9 = A9(:,2)

x10 = A10(:,1)
z10 = A10(:,2)

subplot(3,1,3,'Position',[0.15 0.1 0.8 0.3])
hold on
%scatter(x1,z1,1,'filled','MarkerFaceColor',[0.2 0 0.8])
plot(x1,z1,'Linewidth',0.5,'Color',[0.2 0 0.8])
plot(x2,z2,'Linewidth',0.5,'Color',[0.2 0 0.8])
plot(x3,z3,'Linewidth',0.5,'Color',[0.2 0 0.8])
plot(x4,z4,'Linewidth',0.5,'Color',[0.2 0 0.8])
plot(x5,z5,'Linewidth',0.5,'Color',[0.2 0 0.8])
plot(x6,z6,'Linewidth',0.5,'Color',[0.2 0 0.8])
plot(x7,z7,'Linewidth',0.5,'Color',[0.2 0 0.8])
plot(x8,z8,'Linewidth',0.5,'Color',[0.2 0 0.8])
plot(x9,z9,'Linewidth',0.5,'Color',[0.2 0 0.8])
plot(x10,z10,'Linewidth',0.5,'Color',[0.2 0 0.8])
ylim([-2.5,2.5])
yticks(-2:2:2)
xlim([0,850])
xticks([0:200:800])
xlabel('Time [s]')
ylabel('Photocurrent [pA]')
set(gca,'box','on','Xcolor',[0 0 0],'Ycolor',[0 0 0])
hold off

subplot(3,1,2,'Position',[0.15 0.4 0.8 0.1])
hold on
plot(x,y2,'Linewidth',0.5,'Color',[0.4 0.6 0])
ylim([-0.2,1.2])
xticklabels([])
yticks(0:1:1)
xlim([0,850])
xticks([0:200:800])
ylabel('Laser')
set(gca,'box','on','Xcolor',[0 0 0],'Ycolor',[0 0 0])
hold off

subplot(3,1,1,'Position',[0.15 0.5 0.8 0.15])
hold on
plot(x,y3,'Linewidth',0.5,'Color',[0.8 0 0.2])
ylim([-15,15])
yticks(-12:12:12)
xlim([0,850])
xticks([0:200:800])
xticklabels([])
ylabel('Field [MV/m]')
set(gca,'box','on','Xcolor',[0 0 0],'Ycolor',[0 0 0])
hold off
box on

set(gcf,'Position',[0, 0, 170, 275])